package day01_IO_JDBC.demo_IO;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class ObjectIODemo {
    public static void main(String[] args) throws Exception{
        ObjectOutputStream objectOutputStream =new ObjectOutputStream(new FileOutputStream(""));
        objectOutputStream.writeObject(new Person("tom",123));
        objectOutputStream.close();


        ObjectInputStream objectInputStream =new ObjectInputStream(new FileInputStream(""));
        Person person = (Person) objectInputStream.readObject();
        System.out.println(person.toString());
        objectInputStream.close();
    }
}
